#pragma once

#include <TQObject.h>
#include <RQ_OBJECT.h>

#include <map>
#include <vector>
#include <string>

class TGWindow;
class TGMainFrame;

#include "CalibTab.h"
#include "CalibData.h"
#include "TomsonScattering.h"
#include "MeasureTab.h"
#include "ConfigTab.h"
#include "CalibOptions.h"

class AppGUI
{
	RQ_OBJECT("AppGUI")
private:
	void CreateDataTab( TGTab * fMainTabs, std::string name );
	void ReadConfig(std::map<std::string, std::vector<double> > &params, std::string &arcName);
        void ParseShot(std::string &shotStr, int &shotNum, std::vector<bool> &chanels);
        void RunCalibrate(std::string arcName, calib_type type, std::vector<ValueWithError> &calib);
        void ConfigureTomsonScattering( std::map<std::string, std::vector<double> > &params );
private:
	CalibData m_calibData;

	CalibTab m_calibTab;
	MeasureTab m_measTab;
	ConfigTab m_configTab;

        VisualizationWrapper *m_visWrapper;
	TomsonScattering m_scatteringMethod;

        TGCompositeFrame *m_mainCompositeFrame;
public:
	void CreateWindow();
        void SaveCalibs();
	void RunCalculate();
        void RunCalibrateBg();
        void RunCalibratePeak();
        void BrowseArc();
        void InvokeReadCalibrations();
        void ShowArcInfo();
};
